import 'package:my_blog_flutter/generated/json/base/json_field.dart';
import 'package:my_blog_flutter/generated/json/login_entity.g.dart';
import 'dart:convert';
export 'package:my_blog_flutter/generated/json/login_entity.g.dart';

@JsonSerializable()
class LoginEntity {
	int? code = 0;
	String? message = '';
	LoginData? data;
	int? timestamp = 0;

	LoginEntity();

	factory LoginEntity.fromJson(Map<String, dynamic> json) => $LoginEntityFromJson(json);

	Map<String, dynamic> toJson() => $LoginEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class LoginData {
	String? token = '';
	String? username = '';

	LoginData();

	factory LoginData.fromJson(Map<String, dynamic> json) => $LoginDataFromJson(json);

	Map<String, dynamic> toJson() => $LoginDataToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}